package com.briup.day11;

import java.util.Arrays;

/**
 * @author 谭梦寻
 * @version 1.1
 */
public class TestGender {
    public static void main(String[] args) {
        Gender g = Gender.MALE;
        Gender g2 = Gender.MALE;
        System.out.println(Gender.FEMALE);//FEMALE
        System.out.println(g == null);//false
        System.out.println(g instanceof Gender);//true
        System.out.println(g == g2);//true
        System.out.println("所有该枚举对象的信息："+ Arrays.toString(Gender.values()));

//        调用抽象父类中继承的方法
        Enum e = Gender.MALE;
        System.out.println(e.name());//MALE
        System.out.println(e.ordinal());//1
        System.out.println(Gender.FEMALE.ordinal());//0
    }
}
